package ShenBlueCenter.json;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.mysql.cj.xdevapi.JsonParser;

import ShenBlueDao.LoginDao;
import jdk.nashorn.internal.parser.JSONParser;
import net.sf.json.JSONObject;

/**
 * Servlet implementation class User_Msg_Json
 */
@WebServlet("/imp/User_Msg_Json")
public class User_Msg_Json extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public User_Msg_Json() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		response.setContentType("application/json");
		response.setCharacterEncoding("utf8");
		HttpSession session = request.getSession();
		String user_id=(String) session.getAttribute("User_id");
		String user_tel=(String) session.getAttribute("User_telephone");
		String user_name=(String) session.getAttribute("User_name");
		String user_pwd=(String) session.getAttribute("User_Password");
		String user_email=(String) session.getAttribute("User_email");
		String user_full=(String) session.getAttribute("User_fullname");
		LoginDao Dao=new LoginDao(user_id, user_tel, user_name, user_pwd, user_email, user_full);
		
		response.getWriter().append(JSONObject.fromObject(Dao).toString());
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		
	}

}
